<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="generator" content=
  "HTML Tidy for Mac OS X (vers 1 September 2005), see www.w3.org" />

  <title>What is PicoContainer?</title>
</head>

<body>
  <p>PicoContainer is a highly embeddable, full-service, Inversion
  of Control (IoC) container for components honor the Dependency
  Injection pattern. The project started in 2003 and pioneered
  Constructor Injection auto-wiring. It is also Open Source and
  therefore free to use. The license is <a href=
  "http://www.opensource.org/licenses/bsd-license.php">BSD</a> and
  thus you can safely use this with commercial or other open source
  software.</p>

  <p>You could use it as a lightweight alternative to Sun's J2EE
  patterns for web applications or general solutions.</p>

  <p>What is Dependency Injection? Martin Fowler has a good
  <a href="http://www.martinfowler.com/articles/injection.html">article</a>
  from 2003, but here is another view: It is a good design pattern
  that, for large enterprise applications, facilitates:</p>

  <ul>
    <li>easy best practice unit testing <i>vs</i> little and
    difficult unit testing.</li>

    <li>component reuse <i>vs</i> rewriting through ignorance or
    perceived needs</li>

    <li>configuration given to components<i>vs</i> components reading
    their own scattered config</li>

    <li>clean &amp; declarative architecture <i>vs</i> a nest of
    singletons that nobody can make sense of</li>

    <li>maintainability <i>vs</i> developers having difficulties
    fixing bugs</li>

    <li>adaptability <i>vs</i> developers not knowing where to
    start to add features</li>

    <li>transparency <i>vs</i> lots of framework code, with
    consequential lock in</li>
  </ul>

  <p>Dependency Injection is quite often, but not exclusively, used
  by Agile practitioners. It counters situations where enterprise
  applications:</p>

  <ul>
    <li>have grown to be thousands of classes, with dozens if not
    hundreds of Singletons</li>

    <li>draw similarities to Spaghetti, Hairballs or <a href=
    "http://www.laputan.org/mud/">Balls of Mud</a></li>

    <li>has made development staff looking after it miserable, and
    wanting to quit</li>

    <li>suffers repeated allegations of "it cannot be further
    developed without complete rewrite"</li>
  </ul>

  <p>Despite it being very compact in size (the core is ~260K and
  it has no mandatory dependencies outside the JDK), PicoContainer
  supports different dependency injection types (Constructor,
  Setter, Annotated Field / Method) and offers multiple lifecycle
  and monitoring strategies.</p>

  <p>If you're trying to understand the difference between
  PicoContainer and similar libraries, then its best to think of
  PicoContainer as a map that where add() is for types and
  implementations, and get() is for instances.</p>

  <p>PicoContainer has originally been implemented in Java but is
  also available for other platforms and languages. These are
  detailed <a href=
  "http://docs.codehaus.org/display/PICO/Ports">here</a>.</p>

  <h3>Read More?</h3><span class="callout">The <a href=
  "introduction.html">Introduction</a> page discusses basic
  PicoContainer usage, and has pictures - yay!</span>
</body>
</html>
